<?php

namespace System;

use Library\FileLoader;
use Library\JSONParser;

define("CONFIG_PATH", ROOT_PATH . "/Config");

class ConfigLoader {

    public static function getConfig($configName) {
        $fileLoader = new FileLoader();
        $path = CONFIG_PATH . "/" . $configName . ".json";
        $fileLoader->setPath($path);
        $content = $fileLoader->getContent();
        $parser = new JSONParser();
        $parser->setString($content);
        return $parser->stringToObject();
    }

}